<template>
	<view class="">
		<u-popup v-model="show" mode="center" width="80%" >
					<view class="popup_content" >
						
						<view class="popup_desc">
							<block v-if="popub_data.wts_img_w && popub_data.wts_img_t">
							你有一份文字商标委托书和一份图片商标委托书需要打印盖章
						    </block>
							<block v-if="!popub_data.wts_img_w && popub_data.wts_img_t">
							你有一份图片商标委托书需要打印盖章
							</block>
							<block v-if="popub_data.wts_img_w && !popub_data.wts_img_t">
							你有一份文字商标委托书需要打印盖章
							</block>
							，请点击下方按钮然后长按图片选择将图片发送到你的电脑微信上或保存到相机上打印出来并在图片右下角委托人章戳处盖章，最后回到平台提交。
						   </view>
					  <view class="popup_button">
						  
						  
						  <u-button v-if="popub_data.wts_img_w"   type="primary" throttle-time="1000" @click="showimg(popub_data.wts_img_w)">查看文字商标委托书</u-button>
						  <block v-if="popub_data.wts_img_t">
						  <view style="height: 20px;"></view>
						  <u-button type="success"  throttle-time="1000" @click="showimg(popub_data.wts_img_t)">查看图片商标委托书</u-button>
					      	</block>
					  </view>
					  
					  <u-toast ref="uToast" />
					</view>
				</u-popup>
		
	</view>
</template>

<script>
	import {mapState,mapGetters} from "vuex"
	export default {
		props: {
			popub_data: {
				type:Object,
				default: {}
			}
			
		}, 
		data () {
		return {
		  show:false,
		  loading:false
		}
  },
		computed:{
			
		},
		created:function(){
			console.log(this.$store.getters.total)
		},
		methods:{
			showimg(url){
					
				   uni.previewImage({
				   	urls: [url],
				   	longPressActions: {
				   		itemList: [],
				   		success: function(data) {
				   			console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
				   		},
				   		fail: function(err) {
				   			console.log(err.errMsg);
				   		}
				   	}
				   });
			},
			show_pupop(){
			    this.show=true	
			},
			down(url) {
				this.loading=true
				uni.downloadFile({
					url: url,
					success: (res) => {
						if (res.statusCode === 200) {
						   this.loading=false
							uni.saveImageToPhotosAlbum({
								filePath: res.tempFilePath,
								success: function() {
							
			                         
								}
							});
						}
					}
				});
			
			}
		}
	
	}
</script>

<style>
	
	.popup_desc{font-size: 16px; line-height: 25px;}
	.popup_button{ margin-top: 30px;}
	.popup_button u-button{ margin-bottom: 10px;}
	 .popup_content{padding: 20px; box-sizing: border-box; }
</style>
